<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<table border="0px" cellspacing="" cellpadding="">
			<tr>
				<td id="td1"><img src="img/家具/1.jpg" id="imgs" ></td>
			</tr>
			<tr>
				<td><button type="button" onclick="start(event)">开始</button></td>
			</tr>
		</table>
	</body>
	<script type="text/javascript">
	    function randomNumber(){
			while(true){
				var num=Math.floor(Math.random()*10)
				if(num!=0){
					return num;
				}
			}
		}
		function start(event){
			event.target.innerText='更换中'
			setInterval(function(){
				var imgObject = document.getElementById('imgs');
				console.log(imgObject);
				var randomNum=randomNumber();
				console.log(randomNum);
				imgObject.src='img/家具/'+randomNum+'.jpg';
				console.log(imgObject);
			},500)
			
		}
	</script>
</html>
